import React, { Component } from 'react'

import { Switch,Route } from 'react-router-dom'

import News from './News'
import Message from './Message'

import MyNavLink from '../../components/MyNavLink'

import './index.css'

export default class Home extends Component {
    render() {
        return (
            <div>
                <p>我是Home组件内容</p>
                <div className="component_container">
                    <ul>
                        {/* <li className="menu_item">News</li> */}
                        {/* <li className="menu_item">Message</li> */}
                        <MyNavLink className="menu_item" to="/home/news">News</MyNavLink>
                        <MyNavLink className="menu_item" to="/home/message">Message</MyNavLink>
                    </ul>
                </div>
                <div>
                    <Switch>
                        <Route path="/home/news" component={ News } />
                        <Route path="/home/message" component={ Message } />
                    </Switch>
                </div>
            </div>
        )
    }
}
